<html>
<head><meta charset="utf-8"><title>highlighting examples in doc comments? · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/highlighting.20examples.20in.20doc.20comments.3F.html">highlighting examples in doc comments?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="243536174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/highlighting%20examples%20in%20doc%20comments%3F/near/243536174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Yu [they/she] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/highlighting.20examples.20in.20doc.20comments.3F.html#243536174">(Jun 22 2021 at 15:44)</a>:</h4>
<p>i'm working on libstd, and sometimes code examples in doc comments get highlighted, but sometimes not. is this expected? do i need to be more patient for some slow processing to catch up?</p>



<a name="243538502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/highlighting%20examples%20in%20doc%20comments%3F/near/243538502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/highlighting.20examples.20in.20doc.20comments.3F.html#243538502">(Jun 22 2021 at 16:01)</a>:</h4>
<p>Hard to say, might be a bug, might something like "code is cfged-out". If this is minizes to a usual cargo project, that's def a bug!</p>



<a name="243538808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/highlighting%20examples%20in%20doc%20comments%3F/near/243538808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/highlighting.20examples.20in.20doc.20comments.3F.html#243538808">(Jun 22 2021 at 16:04)</a>:</h4>
<p>If the doc comment is inside/on a cfg-ed out item then its expected. Otherwise its most likely a bug.</p>



<a name="243539333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/highlighting%20examples%20in%20doc%20comments%3F/near/243539333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Yu [they/she] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/highlighting.20examples.20in.20doc.20comments.3F.html#243539333">(Jun 22 2021 at 16:07)</a>:</h4>
<p>for the most part since the most recent update, it is managing to highlight doc comment examples more consistently now, probably due to the cfg(test) issue that was recently fixed? i guess technically i'm working inside libcore, which was the main thing that was affected. but it can still take a while (bulk of actual module code gets highlighted, but the formatting of examples takes a while to catch up)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>